// eslint-disable-next-line @typescript-eslint/no-var-requires
const proxy = require('http-proxy-middleware');
// eslint-disable-next-line @typescript-eslint/no-var-requires
// const { Passport } = require('@casstime/passport');

// const userLoginId = 'zkk';
// const password = '123456';

// const ACCESS_TOKEN_KEY = 'ACCESS_TOKEN';
// const passport = new Passport({
//   clientId: 'admin',
//   secretKey: '123456',
//   origin: 'https://test-api.casstime.com',
// });

module.exports = {
  plugins: ['gatsby-plugin-sass'],
  developMiddleware: app => {
    app.use(
      proxy(['/tenant/webim'], {
        target: 'http://10.44.19.107/',
        changeOrigin: true,
      }),
    );
    app.use(
      proxy(['/activity', '/portal'], {
        target: 'https://10.44.19.107/',
        changeOrigin: true,
      }),
    );
  },
};
